﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Bibilioteca.Models
{
    public class Cuenta
    {
        public int Id { get; set; }

        [StringLength(25, MinimumLength = 2)]
        [Required]
        public string Usuario { get; set; }

        [StringLength(25, MinimumLength = 2)]
        [Required]
        public string Password { get; set; }

        [Required]
        public int socioId { get; set; }

        public bool esAdmin { get; set; }

        public int Reservas { get; set; }

        public int Prestamos { get; set; }

        public bool Habilitada { get; set; }
        
        public Cuenta(int _id, string _user, string _pass, int socio,
                        bool admin = false, int res = 0, int pres = 0, bool habil = true                        
                     )
        {
            Id = _id;
            Usuario = _user;
            Password = _pass;
            socioId = socio;
            esAdmin = admin;
            Reservas = res;
            Prestamos = pres;
            Habilitada = habil;
        }

        /*
         * Utilizada para socio que no tiene cuenta.
         */
        public Cuenta(int _id)
        {
            Id = _id;
        }


    }
}